﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class News : System.Web.UI.Page
{
    public int lang;
    public string url = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (!this.IsPostBack)
        {
            int loai = Convert.ToInt32(Request.QueryString["loai"]);
            lang = 2;
            if (Request.QueryString["lang"] != "" && Request.QueryString["lang"] != null) lang = Convert.ToInt32(Request.QueryString["lang"]);

            TinTucDataSet gtDs = new TinTucHelper().LoadTinTuc(loai, lang);
            rptAnhLon.DataSource = gtDs;
            rptAnhNho.DataSource = gtDs;
            rptAnhLon.DataBind();
            rptAnhNho.DataBind();
            if (lang == 1)
            {
                url = "<a href='/TinTuc.aspx?lang=1' >Tin tức </a> >> ";
            }
            else
            {
                url = "<a href='/TinTuc.aspx?lang=2' >Hot news </a> >> ";
            }
            lbpageName.Text = url + LoaiDataHelper.LoadLoaiTinTuc(lang)[loai].ToString();
        }
    }
}
